import { makeObservable, observable, action } from "mobx";
export default class AppleStore {
  constructor(id) {
    this.id = id
    this.name = `红苹果-${id}号`
    this.weight = (200 +Math.random()*10).toFixed(0)
    this.isEated = false
    makeObservable(this, {
      isEated: observable,
      eatApple: action.bound
    })
  }

  eatApple(){
    this.isEated = true
  }
}